package com.longtop.framework.sys.user.web;

import com.longtop.framework.base.BaseAction;
import com.longtop.framework.sys.user.service.UserService;
import com.longtop.framework.util.WebUtil;
import com.longtop.intelliweb.action.IInitContext;
import com.longtop.intelliweb.view.Dataset;

public class DutyDropdownAction extends BaseAction {

	private final String DATASET_DUTY = "Dataset_Duty";

	/**
	 * 系统共用：初始化调用
	 */
	public void init(IInitContext context) {
		super.init(context);
	}

	/**
	 * 本页jsp：初始化业务数据(覆写父类方法)
	 */
	public void thisPageInit(IInitContext context) {
		Dataset dataset = context.getDataset(DATASET_DUTY);
		if (!WebUtil.validateDatasetExist(this, dataset, DATASET_DUTY)) {
			return;
		}
		try {
			UserService service = getBean(UserService.BEAN_ID);
			service.queryForPageByIbatis("sysUserSql.queryUserDutyTree", null, null, dataset, false);
		} catch (Exception e) {
			e.printStackTrace();
			hintErrorMessage("加载错误。");
		}

	}
}
